package cn.edu.buaa.cnsatm.traffic_big_data_server.division.controller;

import cn.edu.buaa.cnsatm.traffic_big_data_server.division.service.TheaterDivisionService;
import cn.edu.buaa.cnsatm.traffic_big_data_server.waterway.service.SeaStatusService;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import java.sql.SQLException;
import java.text.ParseException;

/**
 * @name = LX
 * @classname = TheaterDivisionController
 * @description = 战区区划相应接口
 * @date = 2019/10/23
 */
@RestController
public class TheaterDivisionController {
    /**
     * @author LX
     * @return 见接口文档
     * @description 获取经纬度所在省和战区
     * @since 2019-10-23
     */
    @RequestMapping("/theaterDivision")
    @ResponseBody
    public String webGetTheaterDivisionByLonAndLa(
            @RequestParam(value = "longitude",required = true) Double longitude,
            @RequestParam(value = "latitude",required = true) Double latitude
    ) throws SQLException, ParseException {
        return TheaterDivisionService.getTheaterDivisionByLonAndLa(longitude, latitude);
    }

//    SELECT route_code,count,geom,date FROM airroute_capacity as d where date = (select max(date) from airroute_capacity) //date可以加索引


}
